<%@ page import="controllers.SolutionConnect" %>
<%@ page import="controllers.ajxBestOfSitesConnectServlet" %>
<%@ page import="java.util.List,java.text.*"%>
<%@ page import="java.util.List, java.util.HashMap" %>
<%@ page import="controllers.CommonConnect" %>

<%



String Region = (String) request.getParameter("region");
String Month = (String) request.getParameter("month");

String useremail = (String) pageContext.getAttribute("USER_EMAILID", PageContext.PAGE_SCOPE);
CommonConnect Com = new CommonConnect();

String optionName; 
int iRow =0;
if (Region == null) Region="";
if (Month == null) Month="";



ajxBestOfSitesConnectServlet SOL = new ajxBestOfSitesConnectServlet();
List<HashMap<String,Object>> rs = SOL.getAllBestOfSites(Region,Month);

List<HashMap<String,Object>> rsMonthOfYear = Com.getMonthOfYear();
List<HashMap<String,Object>> rsRegion = Com.getRegion();


%>
<!-- Add script for showing DataTable by Kulprapas, Sep20,2012 -->
    <script src="/scripts/jquery.js" type="text/javascript"></script>
        <script src="/scripts/jquery.dataTables.min.js" type="text/javascript"></script>
        <script type="text/javascript">
        

      
        $(document).ready(function () {
            $("#draft").dataTable({
                "sPaginationType": "full_numbers",
                "bJQueryUI": true
            });
                       
        });
        </script>
<!--End: Add script for showing DataTable by Kulprapas, Sep20,2012 -->
<!-- content -->
<!--<a id="mainContent" name="mainContent"/>-->
<div id="lotusContent">
<div class="lotusLayout lotusHeader">
<!--<h1>Savvy Solutions</h1>
<div class="lotusDetails">The Global Operations Excellence collection of Savvy Solutions resulting in cost savings for the company</div>-->
</div>
<!-- View selector -->
<div class="lotusActionBar lotusBtnContainer">
<!-- Buttons -->


<b>Best of Sites </b>
</div>


<table>
<tr>
<td></td>
<td> Select Region : </td><td>
<input name="%%Surrogate_cmbRegion" type="hidden" value="1">





<select name="cmbRegion" id="cmbProcessarea"  class="text-edit">
<option  >--Select Region--</option>
                    <%
                    iRow = 0;
                        while ( iRow < rsRegion.size() ) {
                            
                            optionName = (String) rsRegion.get(iRow).get("Region");
                    %>
                    <% if (Region.equals(optionName)){ %>
                    
                                     <option  selected="selected" value="<%=optionName%>"> <%=optionName%></option>
                    <%}else{ %>
                    <option value="<%=optionName%>"> <%=optionName%></option>
                    <%
                    }
                    iRow++;
                        }
                        optionName = "";
                    %>
</select>



  </td><td></td>
</tr>
<tr><td colspan="3">&nbsp;</td><td></td></tr>
<tr>
<td></td>
<td> Select Month : </td><td>

<input name="GetWhere" type="hidden" value="">

<input name="%%Surrogate_cmbMonth" type="hidden" value="1">


<select name="cmbMonth" id="chkMonth"  class="text-edit">
<option  >--Select Month--</option>
                    <%
                    iRow = 0;
                        while ( iRow < rsMonthOfYear.size() ) {
                        	
                            optionName = (String) rsMonthOfYear.get(iRow).get("MonthOfYear");
                    %>
                    <% if (Month.equals(optionName)){ %>
                    
                                     <option  selected="selected" value="<%=optionName%>"> <%=optionName%></option>
                    <%}else{ %>
                    <option value="<%=optionName%>"> <%=optionName%></option>
                    <%
                    }
                    iRow++;
                        }
                        optionName = "";
                    %>
</select>



  </td><td><span class="lotusBtn lotusBtnAction lotusLeft">
<a href="javascript:GetBestOfSites()"><b>Show</b></a>
</span></td>
</tr>
</table>
<br>



    
<div id="dt_example">
    <div id="container">
        <div id="demo_jui">
      <table id="draft" class="display">
          <thead>
              <tr>
                  <th>Solution ID</th>
                  <th>Site</th>
                  <th>Solution Title</th>
                  <th>Customer</th>
                  <th>Month</th>
              </tr>
          </thead>
          <tbody>
        		<% for(int i = 0 ; i < rs.size() ;i++){
        			//float PB = (Float) rs.get(i).get("hardSavings") + (Float) rs.get(i).get("costAvoidance") + (Float) rs.get(i).get("oppurtunityCost");
        			
        			%>
		  <tr>
		    <td><a href="/modules/default/display-solution.jsp?sol_id=<%=rs.get(i).get("SolID")%>"><%=rs.get(i).get("SolCode")%></a></td>
		    <td><a href="/modules/default/display-solution.jsp?sol_id=<%=rs.get(i).get("SolID")%>"><%=rs.get(i).get("Site")%></a></td>
		    <td><a href="/modules/default/display-solution.jsp?sol_id=<%=rs.get(i).get("SolID")%>"><%=rs.get(i).get("Title")%></a></td>
		    <td><a href="/modules/default/display-solution.jsp?sol_id=<%=rs.get(i).get("SolID")%>"><%=rs.get(i).get("customer")%></a></td>
		    <td><a href="/modules/default/display-solution.jsp?sol_id=<%=rs.get(i).get("SolID")%>"><%=rs.get(i).get("Month")%></a></td>
		  </tr>
		<% } %>
          </tbody>
      </table>
	  </div>
    </div>
</div>



<!--End of Lotus Content-->
</div>
<!--End of Lotus Main-->
</div>
<!-- Footer gets moved to within Frame div in weblog.vm so closing tags need to go in weblog.vm - MTodd November 1 2007 </body> </html> -->
</div>
</div>
<input name="Remote_User" type="hidden" value="CN=Wai Tat See/OU=SG/OU=Asia/O=Celestica">
<input name="SaveOptions" type="hidden" value="0">
<input name="HTTP_Cookie" type="hidden" value="redirectto=/global/collaboration/SavvySol.nsf/frmsavvy%3FOpenForm%26login; LtpaToken=ZDKFFoPfuAGbPyVskMUDPgxWENdj6diTwzdqpeE75D7FBQstuBp54bmVG+1NUJgipQeljrUEAnGe8B8Hy4xO6Ip1B52UiBE2D38M/XtiBuuR1VTHf9sxTVPakjCO9kRh+u37exCde0HW4anckpDjCjBca3xmtNzAztKf7ZrCju09loEt1Bbj4tXt3D3Jwfgtr7mnXY7p99bsDfsdzGSxIGE0B5FexyBHR/02R0sCOp7AvkieyyEV4PETctlJwZT8Ll6bckcIDlUK80b0FuGcQHsOp/aCxwhm6H6EjZNBuiuuBsLGX6COlAyNIofKNnjmdvfdhh6/RrWFw9ttyxMbKs33t1bWwTIdLBpGwcEg748=">
<input name="Query_String_Decoded" type="hidden" value="OpenForm&amp;login">
<input name="Query_String" type="hidden" value="OpenForm&amp;login">
<input name="dbName" type="hidden" value="global/collaboration/SavvySol.nsf">
<input name="Position" type="hidden" value="">
<input name="curUsername" type="hidden" value="CN=Wai Tat See/OU=SG/OU=Asia/O=Celestica">
<input name="QuickSearch" type="hidden" value="0">
<input name="UserProfileInfo" type="hidden" value="">
<input name="txtProfileUNID" type="hidden" value="">